import { request } from '@/service/request';

/** 获取小游戏配置列表 */
export function fetchGetGameConfigList (params?: Api.Games.GameConfigSearchParams) {
    return request<Api.Games.GameConfigList>({
        url: '/games/gameConfig/list',
        method: 'get',
        params
    });
}

/** 新增小游戏配置 */
export function fetchCreateGameConfig (data: Api.Games.GameConfigOperateParams) {
    return request<boolean>({
        url: '/games/gameConfig',
        method: 'post',
        data
    });
}

/** 修改小游戏配置 */
export function fetchUpdateGameConfig (data: Api.Games.GameConfigOperateParams) {
    return request<boolean>({
        url: '/games/gameConfig',
        method: 'put',
        data
    });
}

/** 批量删除小游戏配置 */
export function fetchBatchDeleteGameConfig (gameIds: CommonType.IdType[]) {
    return request<boolean>({
        url: `/games/gameConfig/${gameIds.join(',')}`,
        method: 'delete'
    });
}
